﻿using BBI.Infrastructure.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace BBI.Data
{
    public class ArticleHelper
    {
        public static void BindCategoriesToListControl(ListControl lCtrl, long selectedId, BBIUow Uow)
        {
            //  BBICMSUow Uow = new BBICMSUow();
            lCtrl.DataTextField = "Title";
            lCtrl.DataValueField = "CategoryID";
            var lCategories = Uow.Categories.GetAll().OrderBy(c => c.Importance).ToList();
            lCtrl.DataSource = lCategories;
            lCtrl.DataBind();
            UIUtility.SelectListControlItem(ref lCtrl, selectedId);

        }
    }
}
